package edu.guet.server.mapper;

import edu.guet.server.model.Course;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CourseMapper {

    @Insert("insert into course (tech_id,resource_id,course_intro) values (#{tech_id},#{resource_id},#{course_intro})")
    @Options(useGeneratedKeys = true, keyProperty = "course_id", keyColumn = "course_id")
    void addCourse(Course course);

    @Select("SELECT * from course where tech_id=#{techId}")
    Course findCourseByTechId(Integer techId);

    @Select("SELECT * from course where course_id=#{courseId}")
    Course getCourseByCourseId(Integer courseId);

    void updateCourse(Course course);

    //    @Insert("INSERT INTO course values ")
//    void addTechCourse(Integer userId, Integer courseId);
}
